package captcha_v1

import (
	"context"
	v1 "gf-xb-api/api/captcha/v1"
	"gf-xb-api/utility/xcaptcha"
)

func (s *sCaptcha) Reload(ctx context.Context, captchaId string) (res *v1.ReloadRes, err error) {

	id, code, err := xcaptcha.Reload(captchaId)
	if err != nil {
		return nil, err
	}

	res = &v1.ReloadRes{
		CaptchaId:   id,
		CaptchaCode: code,
	}

	return res, nil
}
